package com.example.myapplication6;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SecondActively extends AppCompatActivity {
 TextView tv;
 String name;
 String question="学习没有劲";


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout);

        tv=findViewById(R.id.tvText);
        name=getIntent().getStringExtra("name");
        tv.setText(name+"同学:"+question);


        findViewById(R.id.btnin1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String result="有";
                Intent mIntent=new Intent();
                mIntent.putExtra("result",result);
                setResult(1001,mIntent);
                finish();
            }
        });


        findViewById(R.id.btnout2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String result="没有";
                Intent mIntent=new Intent();
                mIntent.putExtra("result",result);
                setResult(1001,mIntent);
                finish();
            }
        });
    }


    }
